@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-8">
                <div class="card">
                    <div class="card-header">支付</div>

                    <div class="card-body">
                        <p>您预定了：{{ $payinfo['from'] }} ~ {{ $payinfo['to'] }} 的 {{ $payinfo['type']->name }}</p>
                        @if ($payinfo['price'] < 0)
                            <p>需退还： {{ -$payinfo['price'] }}</p>
                        @else
                            <p>需支付：{{ $payinfo['price'] }}</p>
                        @endif
                    </div>

                    <div class="card-footer">
                        <div class="row">
                            <div class="col-auto">
                                <a class="btn btn-secondary" href="{{ route('cancelPay') }}" role="button">取消</a>
                            </div>
                            <div class="col-auto">
                                <form action="{{ route('pay') }}" method="post">
                                    @csrf
                                    <input type="submit" class="btn btn-success" value="确认支付">
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
